import request from '@/utils/request'

// 查询库存收发列表
export function listPicking(query) {
  return request({
    url: '/system/picking/list',
    method: 'get',
    params: query
  })
}

// 查询库存收发详细
export function getPicking(id) {
  return request({
    url: '/system/picking/' + id,
    method: 'get'
  })
}

// 新增库存收发
export function addPicking(data) {
  return request({
    url: '/system/picking',
    method: 'post',
    data: data
  })
}

// 修改库存收发
export function updatePicking(data) {
  return request({
    url: '/system/picking',
    method: 'put',
    data: data
  })
}

// 删除库存收发
export function delPicking(id) {
  return request({
    url: '/system/picking/' + id,
    method: 'delete'
  })
}
// 查询库存收发详细(包括子项)
export function getPickingDetail(id) {
  return request({
    url: '/system/picking/movePartsInfo/' + id,
    method: 'get'
  })
}
// 发货
export function send(data) {
  return request({
    url: '/system/picking/delivery' ,
    method: 'post',
    data
  })
}
// 收货
export function receive(data) {
  return request({
    url: '/system/picking/receive' ,
    method: 'post',
    data
  })
}
// 新增出入库
export function Addmaterialreturnnote(data) {
  return request({
    url: '/system/picking/picking_write' ,
    method: 'post',
    data
  })
}
// 选择产品返回详情
export function addorderzz(id) {
  return request({
    url: '/system/picking/movePart_get/'+id ,
    method: 'get',
   
  })
}
// 订单行删除  提交前
export function delorderzz(id) {
  return request({
    url: '/system/picking/movePart_delete/'+id+'/t' ,
    method: 'get',
   
  })
}
// 订单行删除  写入后
export function delorderzz1(id) {
  return request({
    url: '/system/picking/movePart_delete/'+id+'/f' ,
    method: 'get',
   
  })
}
// 订单行修改  新增时 返回详情信息渲染
export function editorderzz(id) {
  return request({
    url: '/system/picking/movePart_info/'+id+'/t' ,
    method: 'get',
   
  })
}



// 订单行修改  写入后  返回详情信息渲染
export function editorderzz1(id) {
  return request({
    url: '/system/picking/movePart_info/'+id+'/f' ,
    method: 'get',
   
  })
}
// 订单行修改提交  
export function editorderzzsub(data) {
  return request({
    url: '/system/picking/movePart_update' ,
    method: 'put',  
    data
  })
}
// 放弃提交  
export function cancelsale() {
  return request({
    url: '/system/picking/pickingUpdate_abandon' ,
    method: 'get',
   
  })
}
// 提交扣减库存 
export function czstock(id) {
  return request({
    url: '/system/picking/picking_confirm/'+id ,
    method: 'get',
   
  })
}